Skip to main content

Working with databases

Create a new database

ctx := context.Background()
options := driver.CreateDatabaseOptions{ /*...*/ }
db, err := client.CreateDatabase(ctx, "myDB", &options)
if err != nil {
// handle error
}

Open a database

ctx := context.Background()
db, err := client.Database(ctx, "myDB")
if err != nil {
// handle error
}
 
Help us improve

Anything unclear or buggy in this tutorial? Provide Feedback